<h1 id="GMaps-js-A-Javascript-library-that-simplifies-your-life"><a href="#GMaps-js-A-Javascript-library-that-simplifies-your-life" class="headerlink" title="GMaps.js - A Javascript library that simplifies your life"></a>GMaps.js - A Javascript library that simplifies your life</h1><p>GMaps.js allows you to use the potential of Google Maps in a simple way. No more extensive documentation or large amount of code.</p>
<p>Visit the examples in <a href="http://hpneo.github.com/gmaps/">hpneo.github.com/gmaps</a><br>Go to the API Documentation <a href="http://hpneo.github.io/gmaps/documentation.html">hpneo.github.io/gmaps/documentation.html</a></p>
<h2 id="Build"><a href="#Build" class="headerlink" title="Build"></a>Build</h2><p>If you would like to build gmaps from source run the following at the terminal:</p>
<pre><code class="sh">git <span class="built_in">clone</span> https://github.com/HPNeo/gmaps.git
<span class="built_in">cd</span> gmaps
npm install
grunt
</code></pre>
<h2 id="Changelog"><a href="#Changelog" class="headerlink" title="Changelog"></a>Changelog</h2><h2 id="0-4-15"><a href="#0-4-15" class="headerlink" title="0.4.15"></a>0.4.15</h2><ul>
<li>Add overlay to mouseTarget when click event is set</li>
<li>addControl/createControl now accepts HTML elements or HTML strings</li>
<li>Add containsLatLng to google.maps.Circle</li>
</ul>
<h2 id="0-4-14"><a href="#0-4-14" class="headerlink" title="0.4.14"></a>0.4.14</h2><ul>
<li>Fix bug in drawPolygon</li>
<li>Hide context menu before the zoom is changed</li>
</ul>
<h2 id="0-4-13"><a href="#0-4-13" class="headerlink" title="0.4.13"></a>0.4.13</h2><ul>
<li>Allow unitSystem setting in travelRoute</li>
<li>Add functionality to remove controls</li>
<li>Delegates non custom events to google.map</li>
<li>Convert featureType and elementType toLowerCase in static maps</li>
</ul>
<h2 id="0-4-12"><a href="#0-4-12" class="headerlink" title="0.4.12"></a>0.4.12</h2><ul>
<li>Adds ability to listen for clicks on overlays</li>
</ul>
<h2 id="0-4-11"><a href="#0-4-11" class="headerlink" title="0.4.11"></a>0.4.11</h2><ul>
<li>Add RadarSearch to the places layer</li>
<li>Update default control styles to match new Google Maps release.</li>
</ul>
<h2 id="0-4-10"><a href="#0-4-10" class="headerlink" title="0.4.10"></a>0.4.10</h2><ul>
<li>Fix and optimize removeMarkers</li>
<li>Fix bug in addMarker (issue #270)</li>
</ul>
<h2 id="0-4-9"><a href="#0-4-9" class="headerlink" title="0.4.9"></a>0.4.9</h2><ul>
<li>Add UMD support (AMD, CommonJS, browser globals)</li>
<li>Add retina support</li>
<li>FitZoom only use visible markers</li>
</ul>
<h2 id="0-4-8"><a href="#0-4-8" class="headerlink" title="0.4.8"></a>0.4.8</h2><ul>
<li>Fix getRoutes</li>
</ul>
<h2 id="0-4-7"><a href="#0-4-7" class="headerlink" title="0.4.7"></a>0.4.7</h2><ul>
<li>Add callback for failure in getRoutes</li>
<li>Update marker clusterer after remove marker</li>
<li>Add support for string arrays to arrayToLatLng</li>
</ul>
<h2 id="0-4-6"><a href="#0-4-6" class="headerlink" title="0.4.6"></a>0.4.6</h2><ul>
<li>Allow initialising GMaps without new</li>
<li>Added styled map support for static maps</li>
<li>Fixed name display for styled maps</li>
<li>Allow no zoom for static map request</li>
</ul>
<h2 id="0-4-5"><a href="#0-4-5" class="headerlink" title="0.4.5"></a>0.4.5</h2><ul>
<li>Fix IE8 bug using array_map</li>
<li>Add Grunt and Bower support</li>
</ul>
<h2 id="0-4-4"><a href="#0-4-4" class="headerlink" title="0.4.4"></a>0.4.4</h2><ul>
<li>Fix buildContextMenu reference in addMarker</li>
</ul>
<h2 id="0-4-3"><a href="#0-4-3" class="headerlink" title="0.4.3"></a>0.4.3</h2><ul>
<li>Fix removePolylines and removePolygons</li>
</ul>
<h2 id="0-4-2"><a href="#0-4-2" class="headerlink" title="0.4.2"></a>0.4.2</h2><ul>
<li>Fix drawSteppedRoute</li>
</ul>
<h2 id="0-4-1"><a href="#0-4-1" class="headerlink" title="0.4.1"></a>0.4.1</h2><ul>
<li>Fix fitZoom</li>
</ul>
<h2 id="0-4-0"><a href="#0-4-0" class="headerlink" title="0.4.0"></a>0.4.0</h2><ul>
<li>Split gmaps.js in modules</li>
</ul>
<h2 id="0-3-5"><a href="#0-3-5" class="headerlink" title="0.3.5"></a>0.3.5</h2><ul>
<li>Enable new Google Maps style</li>
</ul>
<h2 id="0-3-4"><a href="#0-3-4" class="headerlink" title="0.3.4"></a>0.3.4</h2><ul>
<li>Add support for context menu in multiple maps</li>
</ul>
<h2 id="0-3-3"><a href="#0-3-3" class="headerlink" title="0.3.3"></a>0.3.3</h2><ul>
<li>Fix destination as address in getRoutes</li>
</ul>
<h2 id="0-3-2"><a href="#0-3-2" class="headerlink" title="0.3.2"></a>0.3.2</h2><ul>
<li>Support for removing Fusion Tables and GeoRSS/KML layers with removeLayer</li>
</ul>
<h2 id="0-3-1"><a href="#0-3-1" class="headerlink" title="0.3.1"></a>0.3.1</h2><ul>
<li>Improve event binding at adding markers, polylines or polygons</li>
</ul>
<h2 id="0-3"><a href="#0-3" class="headerlink" title="0.3"></a>0.3</h2><ul>
<li>Add native events to google.maps objects and custom events to GMaps maps</li>
<li>Check for Google Maps library and defined element when initialize</li>
<li>Allow route origins to be a string or array</li>
</ul>
<h2 id="0-2-31"><a href="#0-2-31" class="headerlink" title="0.2.31"></a>0.2.31</h2><ul>
<li>Fix context menu position bug</li>
</ul>
<h2 id="0-2-30"><a href="#0-2-30" class="headerlink" title="0.2.30"></a>0.2.30</h2><ul>
<li>New feature: StreetView Panoramas</li>
</ul>
<h2 id="0-2-29"><a href="#0-2-29" class="headerlink" title="0.2.29"></a>0.2.29</h2><ul>
<li>New methods: removePolyline and removePolygon</li>
<li>Tests for Styled MapTypes</li>
</ul>
<h2 id="0-2-28"><a href="#0-2-28" class="headerlink" title="0.2.28"></a>0.2.28</h2><ul>
<li>Test suite</li>
<li>Fix double event firing bug</li>
</ul>
<h2 id="0-2-27"><a href="#0-2-27" class="headerlink" title="0.2.27"></a>0.2.27</h2><ul>
<li>Allow create context menus for markers</li>
</ul>
<h2 id="0-2-26"><a href="#0-2-26" class="headerlink" title="0.2.26"></a>0.2.26</h2><ul>
<li>Fix bug in getElevations</li>
<li>Rename fitBounds to fitLatLngBounds</li>
</ul>
<h2 id="0-2-25"><a href="#0-2-25" class="headerlink" title="0.2.25"></a>0.2.25</h2><ul>
<li>Support for GeoJSON in drawPolygon</li>
<li>Use ‘complete’ instead of ‘always’ in GMaps.geolocate</li>
</ul>
<h2 id="0-2-24"><a href="#0-2-24" class="headerlink" title="0.2.24"></a>0.2.24</h2><ul>
<li>New feature: <strong>Overlay Map Types</strong></li>
</ul>
<h2 id="0-2-23"><a href="#0-2-23" class="headerlink" title="0.2.23"></a>0.2.23</h2><ul>
<li>Add full support to google.maps.PolylineOptions</li>
<li>New method: removeMarker</li>
</ul>
<h2 id="0-2-22"><a href="#0-2-22" class="headerlink" title="0.2.22"></a>0.2.22</h2><ul>
<li>New feature: <strong>Map Types</strong></li>
</ul>
<h2 id="0-2-21"><a href="#0-2-21" class="headerlink" title="0.2.21"></a>0.2.21</h2><ul>
<li>Support to add google.maps.Marker objects in addMarker and addMarkers methods.</li>
</ul>
<h2 id="0-2-20"><a href="#0-2-20" class="headerlink" title="0.2.20"></a>0.2.20</h2><ul>
<li>Add support for other HTML block elements instead “div” (like “section”).</li>
</ul>
<h2 id="0-2-19"><a href="#0-2-19" class="headerlink" title="0.2.19"></a>0.2.19</h2><ul>
<li>Use MarkerClusterer to group markers</li>
</ul>
<h2 id="0-2-18"><a href="#0-2-18" class="headerlink" title="0.2.18"></a>0.2.18</h2><ul>
<li>Check if GMaps is defined before load extensions</li>
</ul>
<h2 id="0-2-17"><a href="#0-2-17" class="headerlink" title="0.2.17"></a>0.2.17</h2><ul>
<li>Fix bug with disableDefaultUI option in constructor</li>
</ul>
<h2 id="0-2-16"><a href="#0-2-16" class="headerlink" title="0.2.16"></a>0.2.16</h2><ul>
<li>Fix another bug in createMarker</li>
</ul>
<h2 id="0-2-15"><a href="#0-2-15" class="headerlink" title="0.2.15"></a>0.2.15</h2><ul>
<li>Fix bug in createMarker</li>
</ul>
<h2 id="0-2-14"><a href="#0-2-14" class="headerlink" title="0.2.14"></a>0.2.14</h2><ul>
<li>Adding IDs, classes and innerHTML to createControl. (<strong>Note</strong>: Use ‘content’ instead ‘text’ in createControl)</li>
</ul>
<h2 id="0-2-13"><a href="#0-2-13" class="headerlink" title="0.2.13"></a>0.2.13</h2><ul>
<li>Add support for Places library in addLayer</li>
</ul>
<h2 id="0-2-12"><a href="#0-2-12" class="headerlink" title="0.2.12"></a>0.2.12</h2><ul>
<li>Fix map events without MouseEvent object</li>
<li>Fix bug in drawCircle and drawRectangle</li>
<li>Fix bug in zoomIn and zoomOut</li>
<li>New methods: removePolygon and removePolygons</li>
</ul>
<h2 id="0-2-11"><a href="#0-2-11" class="headerlink" title="0.2.11"></a>0.2.11</h2><ul>
<li>Add support to Panoramio in addLayer</li>
</ul>
<h2 id="0-2-10"><a href="#0-2-10" class="headerlink" title="0.2.10"></a>0.2.10</h2><ul>
<li>New method: toImage</li>
</ul>
<h2 id="0-2-9"><a href="#0-2-9" class="headerlink" title="0.2.9"></a>0.2.9</h2><ul>
<li>Extend the drawSteppedRoute and travelRoute functions</li>
</ul>
<h2 id="0-2-8"><a href="#0-2-8" class="headerlink" title="0.2.8"></a>0.2.8</h2><ul>
<li>New feature: <strong>Layers</strong></li>
</ul>
<h2 id="0-2-7"><a href="#0-2-7" class="headerlink" title="0.2.7"></a>0.2.7</h2><ul>
<li>New method: removeRoutes</li>
<li>Access all native methods of google.maps.Map class</li>
</ul>
<h2 id="0-2-6"><a href="#0-2-6" class="headerlink" title="0.2.6"></a>0.2.6</h2><ul>
<li>Support for multiple overlays</li>
</ul>
<h2 id="0-2-5"><a href="#0-2-5" class="headerlink" title="0.2.5"></a>0.2.5</h2><ul>
<li>Add support to all marker events</li>
<li>Add suport for animations at show and remove overlays</li>
</ul>
<h2 id="0-2-4-1"><a href="#0-2-4-1" class="headerlink" title="0.2.4.1"></a>0.2.4.1</h2><ul>
<li>Create GMaps class only when Google Maps API is loaded</li>
</ul>
<h2 id="0-2-4"><a href="#0-2-4" class="headerlink" title="0.2.4"></a>0.2.4</h2><ul>
<li>New feature: <strong>Elevation service</strong></li>
</ul>
<h2 id="0-2-3"><a href="#0-2-3" class="headerlink" title="0.2.3"></a>0.2.3</h2><ul>
<li>New method: getZoom</li>
</ul>
<h2 id="0-2-2"><a href="#0-2-2" class="headerlink" title="0.2.2"></a>0.2.2</h2><ul>
<li>Minor improvements to support Backbone.js</li>
<li>Fix controls position</li>
</ul>
<h2 id="0-2-1"><a href="#0-2-1" class="headerlink" title="0.2.1"></a>0.2.1</h2><ul>
<li>More default values in GMaps constructor.</li>
</ul>
<h2 id="0-2"><a href="#0-2" class="headerlink" title="0.2"></a>0.2</h2><ul>
<li>Remove jQuery dependency.</li>
</ul>
<h2 id="0-1-12-5"><a href="#0-1-12-5" class="headerlink" title="0.1.12.5"></a>0.1.12.5</h2><ul>
<li>New method “removePolylines” and alias “cleanRoute”</li>
</ul>
<h2 id="0-1-12-4"><a href="#0-1-12-4" class="headerlink" title="0.1.12.4"></a>0.1.12.4</h2><ul>
<li>New methods: fitZoom and fitBounds</li>
</ul>
<h2 id="0-1-12-3"><a href="#0-1-12-3" class="headerlink" title="0.1.12.3"></a>0.1.12.3</h2><ul>
<li>New method: refresh</li>
</ul>
<h2 id="0-1-12-2"><a href="#0-1-12-2" class="headerlink" title="0.1.12.2"></a>0.1.12.2</h2><ul>
<li>New options in GMaps constructor: width and height</li>
</ul>
<h2 id="0-1-12-1"><a href="#0-1-12-1" class="headerlink" title="0.1.12.1"></a>0.1.12.1</h2><ul>
<li>New methods: loadFromFusionTables and loadFromKML</li>
</ul>
<h2 id="0-1-12"><a href="#0-1-12" class="headerlink" title="0.1.12"></a>0.1.12</h2><ul>
<li>New feature: <strong>KML and GeoRSS</strong></li>
<li>Fix bug in getFromFusionTables</li>
</ul>
<h2 id="0-1-11"><a href="#0-1-11" class="headerlink" title="0.1.11"></a>0.1.11</h2><ul>
<li>New feature: <strong>Fusion Tables</strong></li>
</ul>
<h2 id="0-1-10"><a href="#0-1-10" class="headerlink" title="0.1.10"></a>0.1.10</h2><ul>
<li>New feature: <strong>Custom controls</strong></li>
</ul>
<h2 id="0-1-9"><a href="#0-1-9" class="headerlink" title="0.1.9"></a>0.1.9</h2><ul>
<li>New feature: <strong>Static maps</strong></li>
</ul>
<h2 id="0-1-8-10"><a href="#0-1-8-10" class="headerlink" title="0.1.8.10"></a>0.1.8.10</h2><ul>
<li>Better GMaps.Route methods</li>
</ul>
<h2 id="0-1-8-9"><a href="#0-1-8-9" class="headerlink" title="0.1.8.9"></a>0.1.8.9</h2><ul>
<li>Fix typo in Polyline events</li>
<li>Add InfoWindow events</li>
</ul>
<h2 id="0-1-8-8"><a href="#0-1-8-8" class="headerlink" title="0.1.8.8"></a>0.1.8.8</h2><ul>
<li>Add Polyline events</li>
</ul>
<h2 id="0-1-8-7"><a href="#0-1-8-7" class="headerlink" title="0.1.8.7"></a>0.1.8.7</h2><ul>
<li>Add drag and dragstart events to Marker</li>
</ul>
<h2 id="0-1-8-6"><a href="#0-1-8-6" class="headerlink" title="0.1.8.6"></a>0.1.8.6</h2><ul>
<li>Add avoidHighways, avoidTolls, optimizeWaypoints, unitSystem and waypoints options in getRoutes</li>
<li>New method: createMarker</li>
</ul>
<h2 id="0-1-8-5"><a href="#0-1-8-5" class="headerlink" title="0.1.8.5"></a>0.1.8.5</h2><ul>
<li>geolocation and geocode methods are static now (using them with GMaps.geolocation and GMaps.geocode)</li>
</ul>
<h2 id="0-1-8-4"><a href="#0-1-8-4" class="headerlink" title="0.1.8.4"></a>0.1.8.4</h2><ul>
<li>Fix typo in geocode method</li>
<li>Allow all MapOptions in constructor (see ‘MapOptions’ section in Google Maps API Reference)</li>
</ul>
<h2 id="0-1-8-3"><a href="#0-1-8-3" class="headerlink" title="0.1.8.3"></a>0.1.8.3</h2><ul>
<li>Add pane option (‘floatPane’, ‘floatShadow’, ‘mapPane’, ‘overlayImage’, ‘overlayLayer’, ‘overlayMouseTarget’, ‘overlayShadow’) in drawOverlay</li>
<li>New methods: removeOverlay and removeOverlays</li>
</ul>
<h2 id="0-1-8-2"><a href="#0-1-8-2" class="headerlink" title="0.1.8.2"></a>0.1.8.2</h2><ul>
<li>Change pane (‘floatPane’ to ‘overlayLayer’) in drawOverlay</li>
</ul>
<h2 id="0-1-8-1"><a href="#0-1-8-1" class="headerlink" title="0.1.8.1"></a>0.1.8.1</h2><ul>
<li>Fix bug in drawCircle</li>
</ul>
<h2 id="0-1-8"><a href="#0-1-8" class="headerlink" title="0.1.8"></a>0.1.8</h2><ul>
<li>New feature: <strong>Overlays</strong></li>
<li>New method: drawCircle</li>
</ul>
<h2 id="0-1-7-1"><a href="#0-1-7-1" class="headerlink" title="0.1.7.1"></a>0.1.7.1</h2><ul>
<li>Bug fix: zoomIn/zoomOut can change zoom by argument</li>
<li>New method: setZoom</li>
</ul>
<h2 id="0-1-7"><a href="#0-1-7" class="headerlink" title="0.1.7"></a>0.1.7</h2><ul>
<li>New class: <strong>GMaps.Route</strong></li>
</ul>
<h2 id="0-1-6"><a href="#0-1-6" class="headerlink" title="0.1.6"></a>0.1.6</h2><ul>
<li>New feature: <strong>Geofence</strong> (with markers)</li>
<li>New method: <strong>drawPolygon</strong></li>
<li>Bug fix: Change reserved word in Context menu</li>
</ul>
<h2 id="0-1-5"><a href="#0-1-5" class="headerlink" title="0.1.5"></a>0.1.5</h2><ul>
<li>New feature: <strong>Geocoding</strong></li>
<li>New method: <strong>drawSteppedRoute</strong> (similar to travelRoute)</li>
</ul>
<h2 id="0-1-4"><a href="#0-1-4" class="headerlink" title="0.1.4"></a>0.1.4</h2><ul>
<li>New events in <strong>addMarker</strong></li>
<li>Add step_number property in <strong>travelRoute</strong> method</li>
</ul>
<h2 id="0-1-3"><a href="#0-1-3" class="headerlink" title="0.1.3"></a>0.1.3</h2><ul>
<li>New feature: <strong>Context menu</strong> (for map and marker only)</li>
<li>New method: <strong>travelRoute</strong></li>
<li>Change setCenter to panTo in GMaps <strong>setCenter</strong> method</li>
<li>Save entire route data in routes array (instead saving only route path)</li>
<li>Context menu and Route example (using <strong>travelRoute</strong>)</li>
</ul>
<h2 id="0-1-2"><a href="#0-1-2" class="headerlink" title="0.1.2"></a>0.1.2</h2><ul>
<li><strong>drawPolyline</strong> can accept both an array of LatLng objets or an array of coordinates</li>
<li>New methods: <strong>getRoutes</strong> and <strong>drawRoute</strong></li>
<li>Route example</li>
</ul>
<h2 id="0-1-1"><a href="#0-1-1" class="headerlink" title="0.1.1"></a>0.1.1</h2><ul>
<li>Rename <strong>drawRoute</strong> method to <strong>drawPolyline</strong> (more accurate)</li>
<li>Marker example</li>
</ul>
<h2 id="0-1-Initial-release"><a href="#0-1-Initial-release" class="headerlink" title="0.1 - Initial release"></a>0.1 - Initial release</h2><ul>
<li>Map events</li>
<li>Geolocation</li>
<li>Add Markers</li>
<li>Marker infoWindows</li>
<li>Draw routes and circles</li>
<li>Initial examples</li>
</ul>
<h2 id="License"><a href="#License" class="headerlink" title="License"></a>License</h2><p>MIT License. Copyright 2014 Gustavo Leon. <a href="http://github.com/hpneo">http://github.com/hpneo</a></p>
<p>Permission is hereby granted, free of charge, to any<br>person obtaining a copy of this software and associated<br>documentation files (the “Software”), to deal in the<br>Software without restriction, including without limitation<br>the rights to use, copy, modify, merge, publish,<br>distribute, sublicense, and/or sell copies of the<br>Software, and to permit persons to whom the Software is<br>furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice<br>shall be included in all copies or substantial portions of<br>the Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY<br>KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE<br>WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR<br>PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS<br>OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR<br>OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR<br>OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE<br>SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
